//
// Created by kqzhang on 2022/3/17.
//

#include "Site.h"

Site::Site(int idValue, string nameValue) : id(idValue), name(nameValue){}

// bandwidth
void Site::setBandWidth(int value) {
    this->bandWidth = value;
    this->leftWidth = value;
}

int Site::getBandWidth() {
    return this->bandWidth;
}

// qos
void Site::setQos(vector<int> &value) {
    this->qos = value;
}

int Site::getQos(int userId) {
    return this->qos[userId];
}

vector<int>& Site::getQos() {
    return this->qos;
}

// leftBandWidth
void Site::setLeftWidth(int value) {
    this->leftWidth = value;
}

void Site::changeLeftWidth(int value) {
    this->leftWidth = this->leftWidth - value;
}

bool Site::isAssign(int value) {
    if (this->leftWidth - value >= 0) {
        return true;
    }

    return false;
}

int Site::getLeftWidth() {
    return this->leftWidth;
}

// name
string Site::getName() {
    return this->name;
}

void Site::updateLeftBand() {
    this->leftWidth = this->bandWidth;
}
